package com.android.lazysearch;

import java.util.ArrayList;

import android.os.Parcel;
import android.os.Parcelable;

public class Item implements Parcelable{
	
	private String itemName;
	private Float itemPrice;
	private String itemDesc;
	private int itemQty;
	private int itemImage;
	private int itemRating;
	
	public Item(String name, String desc, Float price, int image)
	{
		itemName = name;
		itemDesc = desc;
		itemPrice = price;
		itemQty = 0;
		itemImage = image;
	} 

	public String getItemName()
	{
		return itemName;
	}
	
	public int getItemImage()
	{
		return itemImage;
	}
	
	public Float getItemPrice()
	{
		return itemPrice;
	}
	
	public String getDesc()
	{
		return itemDesc;
	}
	
	public int getItemRating()
	{
		return itemRating;
	}
	
	public Integer getItemQty()
	{
		return itemQty;
	}
	
	public void setItemQty(Integer qty)
	{
		itemQty = qty;
	}
	
	public Item(Parcel source)
	{
        itemName = source.readString();
        itemDesc = source.readString();
        itemPrice = source.readFloat();
        itemQty = source.readInt();
        itemImage = source.readInt();
	}
	
	public int describeContents() {
		return 0;
	}

	public void writeToParcel(Parcel dest, int flags) {
		dest.writeString(itemName);
		dest.writeString(itemDesc);
		dest.writeFloat(itemPrice);
		dest.writeInt(itemQty);
		dest.writeInt(itemImage);
	}
	
	public static final Parcelable.Creator<Item> CREATOR = new Parcelable.Creator<Item>() 
	{
		public Item createFromParcel(Parcel in) 
		{
			return new Item(in);
		}

		public Item[] newArray(int size) 
		{
			return new Item[size];
		}
	};
}
